<template>
	<view>
		<form @submit="submit">
			<view class="cu-bar bg-white solid-bottom margin-top">
				<view class="action">
					<text class="cuIcon-titles text-red"></text>基本信息
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>我的姓名：</view>
				<input placeholder="请输入您的姓名" name="name" :value="formData.name" @blur="handleMatch"></input>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>手机号码：</view>
				<input placeholder="请输入手机号码" name="phone" type="tel" :value="formData.phone"></input>
			</view>
			<!-- 初中高中 -->
			<block v-for="(item,index) in formData.studentList" :key="index">
				<view class="cu-bar bg-white solid-bottom solid-top">
					<view class="action">
						<text class="cuIcon-title text-red"></text>{{item.position}}
					</view>
				</view>
				<view class="cu-form-group">
					<view class="title"><text class="text-red padding-right-xs">*</text>毕业年份：</view>
					<picker name="graduationYear" mode="date" fields="year" :value="item.graduationYear" :end="yearEnd"
						@change="graduationYearChange">
						{{item.graduationYear}}
					</picker>
				</view>
				<!-- align-start -->
				<view class="cu-form-group ">
					<view class="title"><text class="text-red padding-right-xs">*</text>在校类型：</view>
					<picker name="position" :disabled="disabled" @change="positionChange" :value="item.positionIndex"
						:range="positionList">
						<view class="picker">
							{{item.positionIndex>-1?positionList[item.positionIndex]:'请选择'}}
						</view>
					</picker>
				</view>
				<view class=" cu-form-group">
					<view class="title"><text class="text-red padding-right-xs">*</text>毕业班级：</view>
					<picker name="graduationClass" :disabled="disabled" @change="graduationClassChange"
						:value="item.graduationClassIndex" :range="graduationClassList">
						<view class="picker">
							{{item.graduationClassIndex>-1?graduationClassList[item.graduationClassIndex]:'请选择'}}
						</view>
					</picker>
				</view>
			</block>
			<!-- 	<view class="cu-bar bg-white solid-bottom solid-top">
				<view class="action">
					<text class="cuIcon-title text-red"></text>高中
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>毕业年份：</view>
				<picker name="graduationYear" mode="date" fields="year" :value="formData.graduationYear" :end="yearEnd"
					@change="graduationYearChange">
					{{formData.graduationYear}}
				</picker>
			</view>
			<view class="cu-form-group align-start">
				<view class="title"><text class="text-red padding-right-xs">*</text>在校类型：</view>
				<picker name="position" disabled @change="positionChange" :value="positionIndex" :range="positionList">
					<view class="picker">
						{{positionIndex>-1?positionList[positionIndex]:'请选择'}}
					</view>
				</picker>
			</view>
			<view class=" cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>毕业班级：</view>
				<picker name="graduationClass" disabled @change="graduationClassChange" :value="graduationClassIndex"
					:range="graduationClassList">
					<view class="picker">
						{{graduationClassIndex>-1?graduationClassList[graduationClassIndex]:'请选择'}}
					</view>
				</picker>
			</view> -->
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>身份证号：</view>
				<input placeholder="我们将保证您的个人信息安全" name="zjhm" type="idcard" :value="formData.zjhm"></input>
			</view>

			<view class="cu-bar bg-white solid-bottom margin-top">
				<view class="action">
					<text class="cuIcon-titles text-red"></text>教育信息
				</view>
			</view>
			<!-- <view class="cu-form-group">
				<view class="title">最高学历：</view>
				<picker name="graduationGrade" @change="highestChange" :value="highestEducationIndex"
					:range="highestEducationList">
					<view class="picker">
						{{highestEducationIndex>-1?highestEducationList[highestEducationIndex]:'请选择'}}
					</view>
				</picker>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业院校：</view>
				<input placeholder="请输入最高学历毕业院校" name="graduationSchool" :value="formData.graduationSchool"></input>
			</view> -->
			<view class="cu-bar bg-white solid-bottom">
				<view class="action">
					<text class="cuIcon-title text-red"></text>大学
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>毕业学校：</view>
				<input placeholder="请输入最高学历毕业院校" name="universityName" :value="formData.universityName"></input>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>毕业专业：</view>
				<input placeholder="请输入最高学历毕业院校" name="universityMajor" :value="formData.universityMajor"></input>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>毕业年份：</view>
				<picker name="universityYear" mode="date" fields="year" :value="formData.universityYear" :end="yearEnd"
					@change="universityYearChange">
					{{formData.universityYear}}
				</picker>
			</view>
			<view class="cu-bar bg-white solid-bottom">
				<view class="action">
					<text class="cuIcon-title text-red"></text>硕士
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业学校：</view>
				<input placeholder="请输入最高学历毕业院校" name="masterName" :value="formData.masterName"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业专业：</view>
				<input placeholder="请输入最高学历毕业院校" name="masterMajor" :value="formData.masterMajor"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业年份：</view>
				<picker name="masterYear" mode="date" fields="year" :value="formData.masterYear" :end="yearEnd"
					@change="masterYearChange">
					{{formData.masterYear}}
				</picker>
			</view>
			<view class="cu-bar bg-white solid-bottom">
				<view class="action">
					<text class="cuIcon-title text-red"></text>博士
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业学校：</view>
				<input placeholder="请输入最高学历毕业院校" name="doctorName" :value="formData.doctorName"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业专业：</view>
				<input placeholder="请输入最高学历毕业院校" name="doctorMajor" :value="formData.doctorMajor"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">毕业年份：</view>
				<picker name="doctorYear" mode="date" fields="year" :value="formData.doctorYear" :end="yearEnd"
					@change="doctorYearChange">
					{{formData.doctorYear}}
				</picker>
			</view>
			<!-- 工作信息 -->
			<view class="cu-bar bg-white solid-bottom margin-top">
				<view class="action">
					<text class="cuIcon-title text-red"></text>工作信息
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>工作单位：</view>
				<input placeholder="请输入您的工作单位" name="workCompany" :value="formData.workCompany"></input>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>工作地点：</view>
				<input placeholder="请输入您的工作地点" name="workPlace" :value="formData.workPlace"></input>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>所在区域：</view>
				<!-- <input placeholder="请输入您的工作区域" name="workArea" :value="formData.workArea"></input> -->
				<picker mode="multiSelector" :range="areaList" range-key="name" @change="workAreaChange"
					@columnchange="workAreaColumnChange" name="workArea" :value="formData.workAreaDict">
					<view class="picker">{{formData.workAreaDict || '请选择'}} </view>
				</picker>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>单位职务：</view>
				<input placeholder="请输入您的单位职务" name="workPosition" :value="formData.workPosition"></input>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>单位所属类别：</view>
				<picker name="workCategory" @change="workCategoryChange" :value="formData.workCategory"
					:range="workCategoryList">
					<view class="picker">
						{{workCategoryIndex>-1?workCategoryList[workCategoryIndex]:'请选择'}}
					</view>
				</picker>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="text-red padding-right-xs">*</text>具体行业：</view>
				<input placeholder="请输入您的单位具体行业" name="workIndustry" :value="formData.workIndustry"></input>
			</view>
			<!--  -->
			<view class="cu-bar bg-white solid-bottom margin-top">
				<view class="action">
					<text class="cuIcon-title text-red"></text>校友卡照片
				</view>
				<view class="action">
					{{formData.imgList.length}}/9
				</view>
			</view>
			<view class="cu-form-group">
				<view class="grid col-4 grid-square flex-sub margin-top">
					<view class="bg-img" v-for="(item,index) in formData.imgList" :key="index" @tap="ViewImage"
						:data-url="item.previewUrl">
						<image :src="item.previewUrl" mode="aspectFill"></image>
						<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
							<text class='cuIcon-close'></text>
						</view>
					</view>
					<view class="solids" @tap="ChooseImage" v-if="formData.imgList.length<9">
						<text class='cuIcon-cameraadd'></text>
					</view>
				</view>
			</view>
			<view class="cu-bar bg-white solid-bottom margin-top">
				<view class="action">
					<text class="cuIcon-title text-red"></text>其他
				</view>
			</view>
			<view class="cu-form-group align-start">
				<view class="title padding-left-xs">补充说明：</view>
				<textarea placeholder="如有补充,请填写相关信息,以便我们更快的核实您的信息" maxlength="-1" name="remark"></textarea>
			</view>
			<!-- 操作按钮 -->
			<view class="padding flex flex-direction">
				<button class="cu-btn bg-red margin-tb-sm lg" form-type="submit">提交申请</button>
			</view>
		</form>
		<view class="cu-modal bottom-modal" :class="showModal?'show':''" @tap="showModal=false">
			<view class="cu-dialog" @tap.stop="">
				<view class="cu-bar bg-white">
					<view class="action text-green">确定</view>
					<view class="action text-blue" @tap="hideModal">取消</view>
				</view>
				<checkbox-group class="block" @change="CheckboxChange">
					<view class="cu-list menu text-left">
						<view class="cu-item" v-for="(item,index) in ModalList" :key="index">
							<label class="flex justify-between align-center flex-sub">
								<view class="flex-sub">
									{{item.graduationYear+'届&nbsp;'+item.position+'('+item.graduationClass+')&nbsp;'+item.name}}
								</view>
								<checkbox :class="matchIndex==index?'checked':''"
									:checked="matchIndex==index?true:false" :value="index"></checkbox>
							</label>
						</view>
					</view>
				</checkbox-group>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		serviceUrl
	} from '@/common/config.js'
	import {
		card_apply,
		student_match
	} from '@/common/api/api.js'
	import {
		dictItem_list,
		area_list
	} from '@/common/api/spider.js'
	import {
		crmUserInfo
	} from '@/common/api/auth.js'

	export default {
		components: {},
		data() {
			return {
				disabled: true,
				showModal: false,
				matchIndex: -1,
				ModalList: [],
				yearEnd: uni.$s.timeFormat(this.timestamp, 'yyyy'),
				positionIndex: -1,
				positionList: [],
				graduationGradeIndex: -1,
				graduationGradeList: [],
				graduationClassIndex: -1,
				graduationClassList: [],
				highestEducationIndex: -1,
				highestEducationList: [],
				workCategoryIndex: -1,
				workCategoryList: [],
				areaList: [
					[],
					[],
					[]
				],
				areaIndex: [0, 0, 0],
				formData: {
					phone: "",
					middleYear: "",
					graduationYear: "",
					studentList: [],
					universityYear: uni.$s.timeFormat(this.timestamp, 'yyyy'),
					masterYear: uni.$s.timeFormat(this.timestamp, 'yyyy'),
					doctorYear: uni.$s.timeFormat(this.timestamp, 'yyyy'),
					workAreaDict: "",
					imgList: [],
					remark: ""
				},
			};
		},
		async onLoad(e) {
			crmUserInfo().then(res => {
				let data = this.$s.res(res)
				if (data) {
					if (data.phone) {
						this.formData.phone = data.phone
					} else {
						uni.reLaunch({
							url: '/pagesB/phone'
						})
					}
				} else {
					this.$s.gotoAuth()
				}
			})
			dictItem_list({
				code: "position"
			}).then(res => {
				let data = []
				this.$s.res(res).forEach(item => {
					data.push(item.text)
				})
				this.positionList = data
			})
			// dictItem_list({
			// 	code: "graduationGrade"
			// }).then(res => {
			// 	let data = []
			// 	this.$s.res(res).forEach(item => {
			// 		data.push(item.text)
			// 	})
			// 	this.graduationGradeList = data
			// })
			dictItem_list({
				code: "graduationClass"
			}).then(res => {
				let data = []
				this.$s.res(res).forEach(item => {
					data.push(item.text)
				})
				this.graduationClassList = data
			})
			// dictItem_list({
			// 	code: "highestEducation"
			// }).then(res => {
			// 	let data = []
			// 	this.$s.res(res).forEach(item => {
			// 		data.push(item.text)
			// 	})
			// 	this.highestEducationList = data
			// })
			dictItem_list({
				code: "work_category"
			}).then(res => {
				let data = []
				this.$s.res(res).forEach(item => {
					data.push(item.text)
				})
				this.workCategoryList = data
			})
			// this.getArea("0", 0)
			this.areaList[0] = await this.getArea("0")
			this.areaList[1] = await this.getArea(this.areaList[0][0].code)
			this.areaList[2] = await this.getArea(this.areaList[1][0].code)
			// lat a = await this.getArea("0");
			// console.log(await this.getArea("0"))

		},
		// mounted() {
		// 	// let userInfo = uni.getStorageSync("userInfo")
		// 	// this.formData.phone = userInfo.phone
		// },
		methods: {
			addGraduation() {
				this.formData.studentList = [{
					position: "初中",
					positionIndex: this.getIndex("初中", this.positionList),
					graduationYear: "2024",
					graduationClass: this.getIndex("1班", this.graduationClassList)
				}, {
					position: "高中",
					positionIndex: this.getIndex("高中", this.positionList),
					graduationYear: "2024",
					graduationClass: this.getIndex("1班", this.graduationClassList)
				}]
			},
			getArea(pCode) {
				return new Promise((resolve, reject) => {
					area_list({
						pCode
					}).then(res => {
						resolve(this.$s.res(res))
					})
				})
			},
			handleMatch(e) {
				if (e.detail.value) {
					student_match({
						name: e.detail.value
					}).then(res => {
						let aaa = this.$s.res(res)
						if (aaa && aaa.length > 0) {
							this.formData.studentList = []
							this.disabled = true
							// if (aaa.length === 1) {
							// 	this.formData.id = aaa[0].id
							// 	this.formData.graduationYear = aaa[0].graduationYear
							// 	this.positionIndex = this.getIndex(aaa[0].position, this.positionList)
							// 	this.graduationClassIndex = this.getIndex(aaa[0].graduationClass, this
							// 		.graduationClassList)
							// 	uni.showToast({
							// 		icon: 'success',
							// 		title: "匹配成功"
							// 	})
							// } else if (aaa.length > 1) {
							this.ModalList = aaa
							this.showModal = true
							// }
						} else {
							this.disabled = false
							this.addGraduation()
						}
					})
				}
			},
			CheckboxChange(e) {
				console.log("CheckboxChange>>>>>", e)
				var items = this.ModalList,
					values = e.detail.value;
				for (var i = 0, lenI = items.length; i < lenI; ++i) {
					items[i].checked = false;
					for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
						console.log(i, values[j], i == values[j])
						if (i == values[j]) {
							items[i].checked = true;
							break
						}
					}
				}
				this.formData.studentList = []
				this.ModalList.forEach(item => {
					if (item.checked) {
						item.graduationClassIndex = this.getIndex(item.graduationClass, this.graduationClassList);
						item.positionIndex = this.getIndex(item.position, this.positionList);
						this.formData.studentList.push(item)
					}
				})
				console.log(this.formData.graduationList)
			},
			RadioChange(e) {
				console.log("RadioChange>>>>>", e)
				this.matchIndex = parseInt(e.detail.value.split("^")[0])
				let aa = this.ModalList[this.matchIndex];
				this.formData.id = aa.id
				this.formData.position = aa.position
				this.formData.graduationYear = aa.graduationYear
				this.formData.graduationClass = aa.graduationClass
				this.graduationClassIndex = this.getIndex(this.formData.graduationClass, this.graduationClassList);
				this.positionIndex = this.getIndex(this.formData.position, this.positionList);
				this.showModal = false
			},
			// handlezjhm(e) {
			// 	if (e.detail.value) {
			// 		if (this.$s.idCard(e.detail.value)) {
			// 			card_match({
			// 				zjhm: e.detail.value
			// 			}).then(res => {
			// 				let data = this.$s.res(res)
			// 				if (data) {
			// 					this.formData = data
			// 					this.positionIndex = this.getIndex(data.position, this.positionList)
			// 					this.graduationGradeIndex = this.getIndex(data.graduationGrade, this
			// 						.graduationGradeList)
			// 					this.graduationClassIndex = this.getIndex(data.graduationClass, this
			// 						.graduationClassList)
			// 					this.positionIndex = this.getIndex(data.position, this.positionList)
			// 				} else {
			// 					uni.showModal({
			// 						title: '提示',
			// 						content: '未匹配到人员信息',
			// 						showCancel: false,
			// 						success: function(res) {
			// 							if (res.confirm) {
			// 								uni.reLaunch({
			// 									url: './result'
			// 								})
			// 							}
			// 						}
			// 					});
			// 				}
			// 			})
			// 		} else {
			// 			uni.showToast({
			// 				icon: 'none',
			// 				title: "身份证号码格式错误"
			// 			})
			// 		}
			// 	} else {
			// 		uni.showToast({
			// 			icon: 'none',
			// 			title: "请输入身份证号码"
			// 		})
			// 	}
			// },
			getIndex(value, List) {
				let a = 0
				for (let i = 0; i < List.length; i++) {
					if (List[i] === value) {
						a = i
						break;
					}
				}
				return a;
			},
			graduationYearChange(e) {
				this.formData.graduationYear = e.detail.value
			},
			positionChange(e) {
				this.positionIndex = e.detail.value
				this.formData.position = this.positionList[this.positionIndex]
			},
			// graduationGradeChange(e) {
			// 	this.graduationGradeIndex = e.detail.value
			// 	this.formData.graduationGrade = this.graduationGradeList[this.graduationGradeIndex]
			// },
			graduationClassChange(e) {
				this.graduationClassIndex = e.detail.value
				this.formData.graduationClass = this.graduationClassList[this.graduationClassIndex]
			},
			// highestChange(e) {
			// 	this.highestEducationIndex = e.detail.value
			// 	this.formData.highestEducation = this.highestEducationList[this.highestEducationIndex]
			// },
			universityYearChange(e) {
				this.formData.universityYear = e.detail.value
			},
			masterYearChange(e) {
				this.formData.masterYear = e.detail.value
			},
			doctorYearChange(e) {
				this.formData.doctorYear = e.detail.value
			},
			workCategoryChange(e) {
				this.workCategoryIndex = e.detail.value
				this.formData.workCategory = this.workCategoryList[this.workCategoryIndex]
			},
			workAreaChange(e) {
				let multiIndex = e.detail.value
				this.formData.workAreaDict = this.areaList[0][multiIndex[0]].name + "，" +
					this.areaList[1][multiIndex[1]].name + "，" +
					this.areaList[2][multiIndex[2]].name;
				this.formData.workArea = this.areaList[0][multiIndex[0]].code + "," +
					this.areaList[1][multiIndex[1]].code + "," +
					this.areaList[2][multiIndex[2]].code;
				console.log(this.formData.workAreaDict)
			},
			async workAreaColumnChange(e) {
				// this.getArea(this.areaList[e.detail.column][e.detail.value].code, e.detail.column + 1)
				switch (e.detail.column) {
					case 0:
						this.areaList[1] = await this.getArea(this.areaList[0][e.detail.value].code)
						this.areaList[2] = await this.getArea(this.areaList[1][0].code)
						break;
					case 1:
						this.areaList[2] = await this.getArea(this.areaList[1][e.detail.value].code)
						break;
				}
				this.$forceUpdate()
			},
			ChooseImage() {
				if (this.formData.imgList.length < 9) {
					uni.chooseImage({
						count: 1,
						success: (res) => {
							const tempFilePaths = res.tempFilePaths;
							uni.uploadFile({
								url: serviceUrl + 'api/oss/upload',
								filePath: tempFilePaths[0],
								name: 'file',
								success: (uploadFileRes) => {
									if (uploadFileRes.statusCode === 200) {
										let result = JSON.parse(uploadFileRes.data).result
										let img = {
											fileId: result.fileId,
											previewUrl: result.previewUrl
										}
										this.formData.imgList = this.formData.imgList.concat(img)
									}
								}
							});
						}
					});
				}
			},
			ViewImage(e) {
				uni.previewImage({
					urls: this.formData.imgList,
					current: e.currentTarget.dataset.url
				});
			},
			DelImg(e) {
				uni.showModal({
					title: '提示',
					content: '确定要删除这张图片吗？',
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							let img = this.formData.imgList[e.currentTarget.dataset.index]
							this.formData.imgList.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			submit(e) {
				console.log("formData", this.formData)
				var formdata = e.detail.value
				formdata.id = this.formData.id
				formdata.imgList = this.formData.imgList
				formdata.position = this.formData.position
				// formdata.graduationGrade = this.formData.graduationGrade
				formdata.graduationClass = this.formData.graduationClass
				formdata.studentList = this.formData.studentList
				formdata.workCategory = this.formData.workCategory
				formdata.workArea = this.formData.workArea
				console.log("formdata", formdata)

				if (!formdata.name) {
					uni.showToast({
						icon: 'none',
						title: "姓名不能为空"
					})
					return
				}
				if (!formdata.phone) {
					uni.showToast({
						icon: 'none',
						title: "手机号不能为空"
					})
					return
				}
				if (!formdata.studentList || formdata.studentList.length === 0) {
					uni.showToast({
						icon: 'none',
						title: "毕业信息不能为空"
					})
					return
				}
				// if (!formdata.graduationGrade) {
				// 	uni.showToast({
				// 		icon: 'none',
				// 		title: "毕业年级不能为空"
				// 	})
				// 	return
				// }
				// if (!formdata.graduationClass) {
				// 	uni.showToast({
				// 		icon: 'none',
				// 		title: "毕业班级不能为空"
				// 	})
				// 	return
				// }
				if (formdata.zjhm) {
					// if (!this.$s.idCard(formdata.zjhm)) {
					// 	uni.showToast({
					// 		icon: 'none',
					// 		title: "身份证号码格式错误"
					// 	})
					// }
				} else {
					uni.showToast({
						icon: 'none',
						title: "身份证号不能为空"
					})
					return
				}
				if (!formdata.universityName) {
					uni.showToast({
						icon: 'none',
						title: "大学毕业学校不能为空"
					})
					return
				}
				if (!formdata.universityMajor) {
					uni.showToast({
						icon: 'none',
						title: "大学毕业专业不能为空"
					})
					return
				}
				if (!formdata.universityYear) {
					uni.showToast({
						icon: 'none',
						title: "大学毕业年份不能为空"
					})
					return
				}
				if (!formdata.workCompany) {
					uni.showToast({
						icon: 'none',
						title: "工作单位不能为空"
					})
					return
				}
				if (!formdata.workPlace) {
					uni.showToast({
						icon: 'none',
						title: "工作地点不能为空"
					})
					return
				}
				if (!formdata.workArea) {
					uni.showToast({
						icon: 'none',
						title: "工作区域不能为空"
					})
					return
				}
				if (!formdata.workPosition) {
					uni.showToast({
						icon: 'none',
						title: "单位职务不能为空"
					})
					return
				}
				if (!formdata.workCategory) {
					uni.showToast({
						icon: 'none',
						title: "单位所属类别不能为空"
					})
					return
				}
				if (!formdata.workIndustry) {
					uni.showToast({
						icon: 'none',
						title: "单位行业不能为空"
					})
					return
				}
				card_apply(formdata).then(res => {
					this.$s.suc(res)
					console.log("card_apply", this.$s.suc(res))
					if (this.$s.suc(res)) {
						uni.redirectTo({
							url: './detail'
						})
					}
				})
			},
		}
	}
</script>

<style>
</style>